import java.util.Random;
import java.util.Scanner;

public class Test_1 {

//    完成猜数字游戏
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Random random = new Random();
        int randNum = random.nextInt(100);

        while(true){
            System.out.println("请输入您猜的数字");
            int n = scan.nextInt();
            if(n < randNum){
                System.out.println("猜小了");
            }else if(n > randNum){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
            }
        }
    }





//    获取一个数二进制序列中所有的偶数位和奇数位，分别输出二进制序列

    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for(int i = 31;i >= 1;i -=2){
            System.out.print(((n >>> i) & 1) + " ");
        }
        System.out.println();
        for(int i = 30;i >=0;i -= 2){
            System.out.print(((n >>> i) & 1) + " ");
        }
    }




//    写一个函数返回参数二进制中 1 的个数
    public static int bin(int n){
        int count = 0;
        for(int i = 0;i < 32;i++){
            if(((n >> i) & 1) == 1){
                count++;
            }
        }
        return count;
    }

    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        System.out.println(bin(num));
    }




//    求水仙花数

    public static void main1(String[] args) {
        for(int i = 0;i < 999999;i++){
            int count = 0;
            int tmp = i;
            while(tmp != 0){
                count++;
                tmp /= 10;
            }
            tmp = i;
            int sum = 0;
            while(tmp != 0){
                sum += Math.pow((tmp % 10),count);
                tmp /= 10;
            }
            if(sum == i){
                System.out.println(i + "是水仙花数");
            }
        }
    }





}
